package com.jwater.core.manager.master.event;

import com.jwater.core.manager.common.model.WorkerInfo;

/**
 * @description:移除工作进程组事件
 * @author: jnner
 * @createDate: 2021/2/5
 * @version: 1.0
 */
public class RemoveGroupWorkerEvent extends GroupEvent {
    private WorkerInfo workerInfo;

    @Override
    public String getType() {
        return GroupEvent.TYPE_REMOVE_GROUP_WORKER;
    }

    @Override
    public byte[] serialize() {
        return SERIALIZE.serialize(workerInfo);
    }

    @Override
    public RemoveGroupWorkerEvent deserialize(byte[] data) {
        this.workerInfo = SERIALIZE.deserialize(data, WorkerInfo.class);
        return this;
    }

    public WorkerInfo getWorkerInfo() {
        return workerInfo;
    }

    public void setWorkerInfo(WorkerInfo workerInfo) {
        this.workerInfo = workerInfo;
    }
}
